/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.system.bajlam.code.dbentities;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
 *
 * @author Kevin
 */
public class Conexion {
        String dbUrl = "jdbc:mysql://localhost/bajlam";
    String dbClass = "com.mysql.jdbc.Driver";
    String username = "root";
    String pass = "kevin7";
    
    public Conexion(){}
    
    public Connection conectar(){
    Connection link = null;
        try {
        Class.forName(dbClass);
     } catch (ClassNotFoundException ex) {
            Logger.getLogger(Conexion.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
            link = DriverManager.getConnection(dbUrl, username, pass);
        } catch (SQLException ex) {
            Logger.getLogger(Conexion.class.getName()).log(Level.SEVERE, null, ex);
        }
        return link;
    }
}
